# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Guillaume Horel <guillaume.horel@gmail.com
# Contributor: Philipp A. <flying-sheep@web.de>

pkgname=python-unicodedata2
_pyname=${pkgname#python-}
pkgver=15.1.0
pkgrel=1
pkgdesc="unicodedata backport/updates to Python 3"
arch=('loong64' 'x86_64')
url="https://github.com/fonttools/$_pyname"
license=('Apache')
depends=('python')
makedepends=(python-{build,installer,wheel}
             python-setuptools)
checkdepends=(python-pytest
              python-pytest-xdist
              python-pytest-randomly)
_archive="$_pyname-$pkgver"
source=("$url/archive/$pkgver/$_archive.tar.gz")
sha256sums=('71c9207ba1116f9697e68d22024e99078d871554452d4647a44a7ce6986acdf9')

build() {
	cd "$_archive"
	python -m build -wn
}

check() {
	cd "$_archive"
	local _pyver=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
	PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-$_pyver" pytest
}

package() {
	cd "$_archive"
	python -m installer -d "$pkgdir" dist/*.whl
}
